/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.awsmanager.common;

/**
 *
 * @author sodell
 */
public class S3StorageServer {
    protected boolean s3HTTPSonly;
    protected boolean s3DisableDNSbuckets;
    protected String s3ResourcePrefix;
    protected String s3Server;
    protected String s3ServerName;
    protected int s3ServerPort;
    protected String s3serverProxyHost;
    protected int s3serverProxyPort;

    public void setS3DisableDNSbuckets(boolean s3DisableDNSbuckets) {
        this.s3DisableDNSbuckets = s3DisableDNSbuckets;
    }

    public void setS3DisableDNSbuckets(String s3DisableDNSbuckets) {
        this.s3DisableDNSbuckets = false;
        if (s3DisableDNSbuckets != null) {
            if (s3DisableDNSbuckets.trim().equalsIgnoreCase("true")) {
                this.s3DisableDNSbuckets = true;
            }
        }
    }

    public void setS3HTTPSonly(boolean s3HTTPSonly) {
        this.s3HTTPSonly = s3HTTPSonly;
    }

    public void setS3HTTPSonly(String s3HTTPSonly) {
        this.s3HTTPSonly = false;
        if (s3HTTPSonly != null) {
            if (s3HTTPSonly.trim().equalsIgnoreCase("true")) {
                this.s3HTTPSonly = true;
            }
        }
    }

    public void setS3ResourcePrefix(String s3ResourcePrefix) {
        this.s3ResourcePrefix = s3ResourcePrefix;
    }

    public void setS3Server(String s3Server) {
        this.s3Server = s3Server;
    }

    public void setS3ServerName(String s3ServerName) {
        this.s3ServerName = s3ServerName;
    }

    public void setS3ServerPort(int s3ServerPort) {
        this.s3ServerPort = s3ServerPort;
    }

    public void setS3ServerPort(String s3ServerPortStr) {
        this.s3ServerPort = 80;
        if (s3ServerPortStr != null) {
            try {
                this.s3ServerPort = Integer.parseInt(s3ServerPortStr);
            } catch (Exception ex) {
                  this.s3ServerPort = 80;
            }
        }
    }

    public boolean isS3DisableDNSbuckets() {
        return s3DisableDNSbuckets;
    }

    public boolean isS3HTTPSonly() {
        return s3HTTPSonly;
    }

    public String getS3ResourcePrefix() {
        return s3ResourcePrefix;
    }

    public String getS3Server() {
        return s3Server;
    }

    public String getS3ServerName() {
        return s3ServerName;
    }

    public int getS3ServerPort() {
        return s3ServerPort;
    }

    public String getS3serverProxyHost() {
        return s3serverProxyHost;
    }

    public void setS3serverProxyHost(String s3serverProxyHost) {
        this.s3serverProxyHost = s3serverProxyHost;
    }

    public int getS3serverProxyPort() {
        return s3serverProxyPort;
    }

    public void setS3serverProxyPort(int s3serverProxyPort) {
        this.s3serverProxyPort = s3serverProxyPort;
    }

    public void setS3serverProxyPort(String s3serverProxyPortStr) {

        if (s3serverProxyPortStr != null) {
            try {
                this.s3serverProxyPort = Integer.parseInt(s3serverProxyPortStr);
            } catch (Exception ex) {
                this.s3serverProxyPort = -1;
            }
        } else {
            this.s3serverProxyPort = -1;
        }
    }
}
